/*
 * @Author: your name
 * @Date: 2021-08-08 21:44:22
 * @LastEditTime: 2021-11-20 13:27:24
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /blogServe/src/router/moment.router.js
 */
const Router = require('koa-router');


const {
  create,
  detail,
  list,
  update,
  remove
} = require('../controller/moment.controller.js');
const {
  verifyAuth,
  verifyPermission
} = require('../middleware/auth.middleware');

const momentRouter = new Router({prefix: '/moment'});

momentRouter.post('/', verifyAuth, create);
momentRouter.get('/', list)
momentRouter.get('/:momentId', detail);
// 用户必须登录，用户具备权限
momentRouter.patch('/:momentId', verifyAuth, verifyPermission, update);
momentRouter.delete('/:momentId', verifyAuth, verifyPermission, remove);

module.exports = momentRouter;